﻿<script src="~/Scripts/jquery-easyui-extensions/linkbutton/jeasyui.extensions.linkbutton.setStyle.js"></script>

<div class="easyui-panel" data-options="fit:true,border:false" style="padding:20px;">
    <a id="btnTarget" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:false,style:{'background':'gray','color':'black','font-weight':'bold'}">目标按钮</a>
    <br />
    <br />
    <br />
    <a id="btnSet1" class="easyui-linkbutton" data-options="iconCls:'icon-edit'">增加1号样式，红色背景</a><br />
    <a id="btnSet2" class="easyui-linkbutton" data-options="iconCls:'icon-edit'">增加2号样式，绿色背景</a><br />
    <a id="btnSet3" class="easyui-linkbutton" data-options="iconCls:'icon-edit'">增加3号样式，蓝色背景</a><br />
    <a id="btnSet4" class="easyui-linkbutton" data-options="iconCls:'icon-edit'">增加4号样式，黄色背景</a><br />
</div>

<script>
    $(function () {
        $("#btnSet1").click(function () {
            var style = { "background":"red" };
            $("#btnTarget").linkbutton("setStyle", style);
        });

        $("#btnSet2").click(function () {
            var style = { "background": "green" };
            $("#btnTarget").linkbutton("setStyle", style);
        });

        $("#btnSet3").click(function () {
            var style = { "background": "blue" };
            $("#btnTarget").linkbutton("setStyle", style);
        });

        $("#btnSet4").click(function () {
            var style = { "background": "yellow" };
            $("#btnTarget").linkbutton("setStyle", style);
        });
    });
</script>
